﻿using System;
using System.Collections.Generic;
using System.Text;

namespace curbside.Web.UI.WebControls
{
    /// <summary>
    /// Flash视频（FLV）文件播放器
    /// </summary>
    public class FLVPlayer : System.Web.UI.WebControls.HyperLink
    {
        protected override void OnLoad(System.EventArgs e)
        {
            base.OnLoad(e);
            base.NavigateUrl = src;
        }

        protected override void Render(System.Web.UI.HtmlTextWriter writer)
        {
            string jsEventCode = "flowplayer(\"" + this.ClientID + "\",\""
                + helper.wrapSrc("/client/mediaplayer/flowplayer-3.2.2.swf", this.Page) + "\",{clip: conf.defaults, plugins: {controls: conf.skins.gray}});";

            helper.AddStartupScript(this.ClientID, jsEventCode, this.Page);
            base.Render(writer);
        }

        private string src;
        /// <summary>
        /// 设置或获取flash视频src
        /// </summary>
        public string Src
        {
            get { return this.src; }
            set { this.src = value; }
        }
    }
}
